


<form class="form-horizontal" id="userForm" action="/user/update"
	method="POST">
	<div class="panel panel-default">
		<div class="panel-heading">
			<label>修改帐号 </label>
			<button class="btn btn-primary pull-right btn-xs" type="button">提交</button>
		</div>
		<div class="panel-body">
			<input name="user.id" type="hidden" value="${user.id!}">
			<div class="col-sm-3"></div>
			<div class="col-sm-6">

				<div class="form-group ">
					<label class="col-sm-3 control-label no-padding-right">帐号</label>
					<div class="col-sm-9">
						<input type="text" name="user.account" value="${user.account!}"
							class="form-control required" placeholder="登录名">
					</div>
				</div>

				<div class="form-group ">
					<label class="col-sm-3 control-label no-padding-right">IP地址</label>
					<div class="col-sm-9">
						<input type="text" name="user.ip" value="${user.ip!}"
							class="form-control required" placeholder="IP地址">
					</div>

				</div>
			</div>
			<div class="col-sm-3"></div>
		</div>
		<div class="panel-footer">
			<small> 添加新帐号，帐号不能为空。 </small>
			<button class="btn btn-primary pull-right btn-xs" type="button">提交</button>
		</div>
	</div>
</form>

<script>
$(function(){
	$('#userForm').on('click', 'button.btn-primary', function(e){
		e.preventDefault();
		var url = $('#userForm').attr('action');
		$.ajax({
            url: url,
            type:"post",
            data:{
            	id: $('#userForm [name="user.id"]').val(),
            	account: $('#userForm [name="user.account"]').val(),
            	ip: $('#userForm [name="user.ip"]').val()
            },
            success: function(data){
            	$('#content').html(data);
            },
            error: function(e){
            }
        });    
	})
})
	
</script>